package mx.item.temperaturas;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;

public class Temperatura extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_temperatura);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_temperatura, menu);
		return true;
	}
	
	public void hacerConversion(View v){
		EditText etF= (EditText) findViewById(R.id.tfFahrenheit);
		EditText etC= (EditText) findViewById(R.id.tfCelsius);
		String cadF= etF.getText().toString();
		double gf = Double.parseDouble(cadF);
		double gc = (5/9.0)*(gf-32);
		etC.setText(gc+"");
	}
	
	public void mostrarAcercaDe(View v){
		Intent intencion = new Intent(this,AcercaDe.class);
		this.startActivity(intencion);
	}
}
